
public class GPair implements Comparable<GPair>{
	
	public static final String eps = new String(""+((char)2));
	private String nonTerminal, terminal;
	
	public GPair(){
		nonTerminal = null;
		terminal = eps;
	}
	
	public GPair(String terminal){
		nonTerminal = null;
		this.terminal = terminal;
	}	

	public GPair(String terminal, String nonTerminal){
		this.terminal = terminal;
		this.nonTerminal = nonTerminal;
	}
	
	public String toString(){
		if (nonTerminal == null) return terminal;
		else return terminal + nonTerminal; 
	}

	public int compareTo(GPair o) {

		return this.toString().compareTo(o.toString());
	}

}
